class Solution {
public:
    int maxArea(vector<int>& height) {
        int left = 0, right = height.size() - 1;
        int Max = 0;
        for( ; left <= right; )
        {
            int V = (right - left) * min(height[left], height[right]);
            if(Max < V)
                Max = V;

            if(height[left] < height[right])
                left++;
            else
                right--;
        }

        return Max;
    }
};